function addToCart(aid){

    show('loading');
    (new AjaxRequest).send({
        url     : "ajax/",
        data    : {
            action: 'addToCart',
            id:     aid,
            quant:  1
        },

        onSuccess  : function(data, info)
        {
            if($('article_'+aid+'_add')){
                $('article_'+aid+'_add').hide();
                $('article_'+aid+'_added').show();
            }

            if($('no_items_in_cart')){
                $('no_items_in_cart').hide();
            }

            $('items_in_cart').show();

            $('total_items').innerHTML = data.items;
            $('total_price').innerHTML = data.total;
        }
      });
}



function removeFromCart(aid){
    if(!youSure){
      var youSure = 'Sind Sie sicher?';
    }
    if(confirm(youSure)){
        show('loading');
        (new AjaxRequest).send({
            url     : "ajax/",
            data    : {
                action: 'removeFromCart',
                id:     aid
            },

            onSuccess  : function(data, info)
            {
                $('article_'+aid).hide();
                $('total').innerHTML = data.sum;

                if(data.items == 0){
                    $('noitems').show();
                    $('noitems2').hide();
                    $('checkoutcart').disabled = true;
                }
            }
          });
    }
}